home *** CD-ROM | disk | FTP | other *** search
- global curscript
-
- on appendBehavior scr, spr
- curscript = "appendbehaviour"
- Class = script(scr)
- obj = new(Class)
- setaProp(obj, #spriteNum, spr)
- initprops = call(#getPropertyDescriptionList, [Class])
- if ilk(initprops) = #propList then
- thisMany = count(initprops)
- repeat with x = 1 to thisMany
- thisProperty = getPropAt(initprops, x)
- thisValue = getProp(initprops, thisProperty)
- setProp(obj, thisProperty, thisValue.default)
- end repeat
- end if
- set the scriptInstanceList of sprite spr to [obj]
- call(#beginSprite, [obj])
- end
-